package com.example.demo.smartLamp.controller;


import com.example.demo.common.ApiResponse;
import com.example.demo.smartLamp.entity.request.GetAllEnvironmentRequest;
import com.example.demo.smartLamp.entity.request.UserInfoGetRequest;
import com.example.demo.smartLamp.entity.response.GetAllEnvironmentResponse;
import com.example.demo.smartLamp.entity.response.UserInfoGetResponse;
import com.example.demo.smartLamp.service.IEnvironmentService;
import com.example.demo.smartLamp.service.IUserService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 祁荣博 胡绍宇
 * @since 2022-07-23
 */
@RestController
@RequestMapping("/smartLamp/environment")
public class EnvironmentController {

    @Resource
    IEnvironmentService environmentService;

    @ApiOperation(value="获取天气信息")
    @PostMapping("/getAllEnInfo")
    public ApiResponse getAllInfo() throws Exception {
        GetAllEnvironmentResponse getAllEnvironmentResponse = environmentService.getAllEnInfo();
        return ApiResponse.success(getAllEnvironmentResponse);
    }

}
